<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CampManagers extends Migrator
{
    public function up()
    {
        $table = $this->table('camp_manager',array('comment' => '营地管理员表'));
        $table->addColumn('sign', 'uuid', array('comment' => '用户唯一标识'))
              ->addColumn('branch_id', 'integer', array('limit' => 255, 'comment' => '分公司id'))
              ->addColumn('camp_id', 'integer', array('limit' => 255, 'comment' => '营地id'))
              ->addColumn('login_session_id', 'string', array('limit' => 255, 'comment' => '登录session_id','null' => true))
              ->addColumn('name', 'string', array('limit' => 255, 'comment' => '营地管理员姓名'))
              ->addColumn('phone', 'string', array('limit' => 255, 'comment' => '营地管理员手机号')) 
              ->addColumn('email', 'string', array( 'limit' => 255,'comment' => '营地管理员邮箱'))
              ->addColumn('password', 'string', array( 'limit' => 255,'comment' => '营地管理员密码'))
              ->addColumn('created_at', 'timestamp', array('default' => 'CURRENT_TIMESTAMP'))
              ->addColumn('updated_at', 'timestamp', array('null' => true))
              ->addColumn('status', 'integer', array('limit' => 1,'comment' => '营地管理员状态'))//超级管理员=0；
              ->addColumn('idnumber', 'string', array( 'limit' => 255,'comment' => '身份证号','null' => true))
              ->addColumn('remark', 'string', array( 'limit' => 255,'comment' => '备注','null' => true))
              ->addIndex('id')
              ->save();   
    }
    public function down()
    {
        $this->dropTable('camp_manager');
    }
}
